import request from '@/utils/request'

// 查询计划编码列表
export function listCode(query) {
  return request({
    url: '/sales/code/list',
    method: 'get',
    params: query
  })
}

// 查询计划编码详细
export function getCode(codeId) {
  return request({
    url: '/sales/code/' + codeId,
    method: 'get'
  })
}

// 新增计划编码
export function addCode(data) {
  return request({
    url: '/sales/code',
    method: 'post',
    data: data
  })
}

// 修改计划编码
export function updateCode(data) {
  return request({
    url: '/sales/code',
    method: 'put',
    data: data
  })
}

// 删除计划编码
export function delCode(codeId) {
  return request({
    url: '/sales/code/' + codeId,
    method: 'delete'
  })
}

// 计划编码状态修改
export function changeUserStatus(codeId, status) {
  const data = {
    codeId,
    status
  }
  return request({
    url: '/sales/code/changeStatus',
    method: 'put',
    data: data
  })
}
